<!doctype html>
<html lang="en">
<head>
	<meta charset="UTF-8" />
	<title>Document</title>
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<meta content="width=device-width, initial-scale=1" name="viewport"/>
	<meta content="" name="description"/>
	<meta content="" name="author"/>
	<!-- BEGIN GLOBAL MANDATORY STYLES -->
	<link href="./Public/Admin/assets/global/plugins/font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css"/>
	<link href="./Public/Admin/assets/global/plugins/simple-line-icons/simple-line-icons.min.css" rel="stylesheet" type="text/css"/>
	<link href="./Public/Admin/assets/global/plugins/bootstrap/css/bootstrap.min.css" rel="stylesheet" type="text/css"/>
	
	<!-- BEGIN THEME STYLES -->
	<link href="./Public/Admin/assets/global/css/components.css" id="style_components" rel="stylesheet" type="text/css"/>
	
	<link href="./Public/Admin/assets/admin/layout/css/layout.css" rel="stylesheet" type="text/css"/>
	<!--<link href="./Public/Admin/assets/admin/layout/css/themes/darkblue.css" rel="stylesheet" type="text/css" id="style_color"/>-->
	
	<!-- END THEME STYLES -->
	<link rel="shortcut icon" href="favicon.ico"/>
	 <base target="iframe"/>
</head>
<body>
	<form action="" method="post">		
		<table class="table table-bordered table-hover">
			<tr>
				<th>货品ID</th>
				{{foreach from="$name" value='$v' key="$k"}}
				<th>{{$v[0]['attname']}}</th>
				{{endforeach}}
				<th>货号</th>
				<th>库存</th>
				<th>操作</th>
			</tr>
			{{foreach from="$goodslistData" value="$value"}}
			<tr class="info">
				<td>{{$value['glid']}}</td>
				{{foreach from="$value['value']" value="$v"}}
				<td>{{$v}}</td>
				{{endforeach}}				
				<td>{{$value['glnum']}}</td>
				<td>{{$value['gltotal']}}</td>
				<td>
					<a href="{{U('edit',array('glid'=>$value['glid'],'gid'=>Q('get.gid')))}}" class="btn btn-warning"><i class="icon-pencil icon-white"></i>修改</a>
					<a href="{{U('del',array('glid'=>$value['glid']))}}" class="btn btn-danger"><i class="icon-trash icon-white"></i>删除</a>
				</td>
			</tr>
			{{endforeach}}
			<!-- 如果已添加数目小于可能情况数目，才出现添加货品的输入框 -->
			<tr class="info">
				<td>添加货品</td>
				{{foreach from="$name" key="$k" value="$v" }}
				<td>
					
					<select name="{{$k}}">
						<option value="0">-请选择-</option>
						{{foreach from="$v" value="$value"}}
						<option value="{{$value['gaid']}}">{{$value['gavalue']}}</option>
						{{endforeach}}
					</select>
				</td>
				{{endforeach}}
				<td>
					<input type="text" name="glnum" value="0">
				</td>
				<td>
					<input type="text" name="gltotal" value="0">
				</td>
				<td></td>
			</tr>		
		</table>
		<input type="hidden" name="goods_gid" value="{{$gid}}">
		<input type="submit" value="保存添加" class="btn btn-primary">
	</form>
</body>
</html>